import http from '../http'

//二级列表数据
export const SubordinateApi = () => http({
    url: "/brandSecond/select",
    method: "POST",
});

//分页
export const pageSecond = (page, size) => http({
    url: "/brandSecond/selectByPage",
    method: "POST",
    params: {
        page, size
    }
});

//删除
export const delSecond = (id) => http({
    url: "/brandSecond/deleteBrand",
    method: "POST",
    params: {
        id
    }
})

//编辑
export const editSecond = (data={}) => {
    // console.log(data)
    return http({
        url: "/brandSecond/updateBrand",
        method: "POST",
        data
    });
}

//查询品牌接口，上级分类名字
export const brandQuery = () => http({
    url: "/brandFirst/selectAll",
    method: "POST",
})

//新增二级分类
export const addSecond = (count, from, name) => {
    // console.log(count, from, name)
    return http({
        url: "/brandSecond/addBrandS",
        method: "POST",
        params: {
            count,
            from,
            name,
        }
    })
}
